<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录页面</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', sans-serif;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
        }

        .login-container {
            background: rgba(255, 255, 255, 0.95);
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
            width: 100%;
            max-width: 400px;
            transform: translateY(0);
            transition: transform 0.3s ease;
        }

        .login-container:hover {
            transform: translateY(-5px);
        }

        .login-header {
            text-align: center;
            margin-bottom: 40px;
        }

        .login-header h1 {
            color: #2d3436;
            font-size: 2em;
            margin-bottom: 10px;
        }

        .input-group {
            margin-bottom: 25px;
        }

        .input-group input {
            width: 100%;
            padding: 15px;
            border: none;
            background: #f5f6fa;
            border-radius: 10px;
            font-size: 16px;
            transition: all 0.3s ease;
        }

        .input-group input:focus {
            outline: none;
            background: #fff;
            box-shadow: 0 0 10px rgba(78, 205, 196, 0.2);
        }

        .remember-forgot {
            display: flex;
            justify-content: space-between;
            margin-bottom: 25px;
            font-size: 0.9em;
        }

        .remember-forgot a {
            color: #4ecdc4;
            text-decoration: none;
        }

        .login-button {
            width: 100%;
            padding: 15px;
            background: #4ecdc4;
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 16px;
            cursor: pointer;
            transition: background 0.3s ease;
        }

        .login-button:hover {
            background: #45b7b0;
        }

        .signup-link {
            text-align: center;
            margin-top: 25px;
        }

        .signup-link a {
            color: #4ecdc4;
            text-decoration: none;
            font-weight: 600;
        }

        @media (max-width: 480px) {
            .login-container {
                margin: 20px;
                padding: 25px;
            }
        }
    </style>
</head>
<body>
    <div class="login-container">
        <div class="login-header">
            <h1>欢迎登录</h1>
            <p>请输入您的账号信息</p>
        </div>
        <form method="GET" action="/login"> <!-- 添加method和action属性 -->
            <div class="input-group">
                <input type="text" name="username" placeholder="用户名/邮箱" required>
            </div>
            <div class="input-group">
                <input type="password" name="password" placeholder="密码" required>
            </div>
            <div class="remember-forgot">
                <label>
                    <input type="checkbox" name="remember_me"> 记住我
                </label>
                <a href="/forgot-password">忘记密码？</a>
            </div>
            <button type="submit" class="login-button">立即登录</button>
            <div class="signup-link">
                没有账号？ <a href="/register.html">立即注册</a>
            </div>
        </form>
    </div>
    <!-- 在<body>结束前添加优化脚本 -->
        <script>
            // 引入FastClick库消除移动端延迟
            document.addEventListener('DOMContentLoaded', function() {
                if ('addEventListener' in document) {
                    document.addEventListener('DOMContentLoaded', function() {
                        FastClick.attach(document.body);
                    }, false);
                }
            });
        
            // 优化密码切换点击
            document.querySelector('.password-toggle').addEventListener('touchstart', function(e) {
                e.preventDefault();
                togglePassword();
            }, { passive: false });
        
            // 防止多次提交
            document.querySelector('form').addEventListener('submit', function(e) {
                const btn = e.target.querySelector('.signup-button');
                btn.disabled = true;
                btn.style.opacity = '0.7';
                setTimeout(() => {
                    btn.disabled = false;
                    btn.style.opacity = '1';
                }, 2000);
            });
        
            // 增强复选框点击
            document.querySelectorAll('.terms label').forEach(label => {
                label.addEventListener('click', function(e) {
                    const checkbox = this.querySelector('input');
                    checkbox.checked = !checkbox.checked;
                });
            });
        </script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js"></script>
</body>
</html>